<!--
 * @message: 版本管理组件
-->
<template>
  <div id="version">
    <Form inline :label-colon="true" class="search-form" :label-width="80">
      <FormItem label="版本号">
        <Input v-model="params.versionCode"  placeholder="请输入版本号"/>
      </FormItem>
      <FormItem :label-width="0">
        <Button
          type="primary"
          @click="publicGetData()"
          style="margin-right: 10px"
          v-auth="'列表'"
        >搜索
        </Button>
        <Button type="primary" @click="publicUpdateData" v-auth="'新增'">新增</Button>
      </FormItem>
    </Form>
    <Breadcrumb></Breadcrumb>
    <BaseTable
      ref="baseTable"
      :action="action.readVersion"
      :columns="columns"
      :menu-code="menuCode"
      :public-btn="['delete', 'update']"
      @handleRemove="publicRemoveData"
      @handleUpdate="publicUpdateData"
    />
    <Drawer
      :title="viewParams.title"
      v-model="viewParams.flag"
      width="30%"
      @on-visible-change="publicVisibleChange"
    >
      <VersionUpdate
        :type="type"
        @closeView="publicCloseView"
        :key="isRefreshView"
        :idName="idName"
        :moduleId="id"/>
    </Drawer>
  </div>
</template>

<script>
import { tableMixin } from '../../../mixin'
import API_KEY from '../../../api'
import columns from './version-columns'

export default {
  name: 'Version',
  mixins: [tableMixin],
  data () {
    return {
      params: {
        versionCode: ''
      },
      action: {
        // 根据分页参数获取表格数据接口（查询表格数据只需要readMenuByPage参数和columns参数）
        readVersion: API_KEY.log.readVersion,
        removeDataByKey: API_KEY.log.deleteVersion
      },
      columns,
      menuCode: 'log-version',
      id: '',
      idName: 'id',
      suffix: '版本信息'
    }
  },
  components: {
    VersionUpdate: () => import('./VersionUpdate')
  },
  methods: {
  }
}
</script>

<style scoped>

</style>
